package cn.tedu.common.web;

import lombok.Getter;

/**
 * 通过枚举对状态码进行管理
 * 状态码和信息进行绑定
 */
@Getter
public enum ServiceCodeEnum {

    OK(20001,"ok"),

    /**
     * 类别名称重复 状态码和消息绑定
     */
    BAD_REQUEST_CATEGORY_NAME_EXIST(40002,"类别名称重复"),

    BAD_REQUEST(40001,"请求失败"),

    ERROR(50001,"error");


    /**
     * 状态码
     */
    private Integer code;

    /**
     * 提示信息
     */
    private String msg;

    ServiceCodeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

}
